package com.gateway.repository.bean;

import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;

import java.io.Serial;
import java.util.Date;
import com.baomidou.mybatisplus.annotation.Version;
import com.baomidou.mybatisplus.annotation.TableId;
import java.io.Serializable;
import java.util.Objects;

/**
 * <p>
 * 网关插件表
 * </p>
 *
 * @author auto_generation
 * @since 2025-02-06
 */
@TableName("gateway_plugin")
public class GatewayPlugin implements Serializable {

    @Serial
    private static final long serialVersionUID = 1L;

    /**
     * 主键id
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * plugin名称
     */
    private String name;

    /**
     * plugin配置
     */
    private String config;

    /**
     * 环境变量
     */
    private String env;

    /**
     * 启用禁用
     */
    private Boolean enabled;

    /**
     * 没有选择器但依然执行
     */
    private Boolean noSelectorButExecute;

    /**
     * 排序
     */
    private Integer sort;

    /**
     * 备注
     */
    private String remark;

    /**
     * 行记录创建者
     */
    private String creator;

    /**
     * 行记录最近更新人
     */
    private String modifier;

    /**
     * 行记录创建时间
     */
    private Date createdTime;

    /**
     * 行记录最近修改时间
     */
    private Date modifiedTime;

    /**
     * 行版本号
     */
    @Version
    private Integer version;

    /**
     * 拓展字段
     */
    private String extension;

    /**
     * 是否删除
     */
    private Long deleted;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getConfig() {
        return config;
    }

    public void setConfig(String config) {
        this.config = config;
    }

    public String getEnv() {
        return env;
    }

    public void setEnv(String env) {
        this.env = env;
    }

    public Integer getSort() {
        return sort;
    }

    public void setSort(Integer sort) {
        this.sort = sort;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    public String getCreator() {
        return creator;
    }

    public void setCreator(String creator) {
        this.creator = creator;
    }

    public String getModifier() {
        return modifier;
    }

    public void setModifier(String modifier) {
        this.modifier = modifier;
    }

    public Date getCreatedTime() {
        return createdTime;
    }

    public void setCreatedTime(Date createdTime) {
        this.createdTime = createdTime;
    }

    public Date getModifiedTime() {
        return modifiedTime;
    }

    public void setModifiedTime(Date modifiedTime) {
        this.modifiedTime = modifiedTime;
    }

    public Integer getVersion() {
        return version;
    }

    public void setVersion(Integer version) {
        this.version = version;
    }

    public String getExtension() {
        return extension;
    }

    public void setExtension(String extension) {
        this.extension = extension;
    }

    public Long getDeleted() {
        return deleted;
    }

    public void setDeleted(Long deleted) {
        this.deleted = deleted;
    }

    public Boolean getEnabled() {
        return enabled;
    }

    public void setEnabled(Boolean enabled) {
        this.enabled = enabled;
    }

    public Boolean getNoSelectorButExecute() {
        return noSelectorButExecute;
    }

    public void setNoSelectorButExecute(Boolean noSelectorButExecute) {
        this.noSelectorButExecute = noSelectorButExecute;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        GatewayPlugin that = (GatewayPlugin) o;
        return Objects.equals(id, that.id) && Objects.equals(name, that.name) && Objects.equals(config, that.config) && Objects.equals(env, that.env) && Objects.equals(enabled, that.enabled) && Objects.equals(noSelectorButExecute, that.noSelectorButExecute) && Objects.equals(sort, that.sort) && Objects.equals(remark, that.remark) && Objects.equals(creator, that.creator) && Objects.equals(modifier, that.modifier) && Objects.equals(createdTime, that.createdTime) && Objects.equals(modifiedTime, that.modifiedTime) && Objects.equals(version, that.version) && Objects.equals(extension, that.extension) && Objects.equals(deleted, that.deleted);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, name, config, env, enabled, noSelectorButExecute, sort, remark, creator, modifier, createdTime, modifiedTime, version, extension, deleted);
    }

    @Override
    public String toString() {
        return "GatewayPlugin{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", config='" + config + '\'' +
                ", env='" + env + '\'' +
                ", enabled=" + enabled +
                ", noSelectorButExecute=" + noSelectorButExecute +
                ", sort=" + sort +
                ", remark='" + remark + '\'' +
                ", creator='" + creator + '\'' +
                ", modifier='" + modifier + '\'' +
                ", createdTime=" + createdTime +
                ", modifiedTime=" + modifiedTime +
                ", version=" + version +
                ", extension='" + extension + '\'' +
                ", deleted=" + deleted +
                '}';
    }
}
